.PHONY: build run test clean build-windows build-linux build-darwin

BINARY_NAME=server
BINARY_NAME_WINDOWS=server.exe

build: build-windows

build-windows:
	GOOS=windows GOARCH=amd64 go build -o ${BINARY_NAME_WINDOWS} cmd/server/main.go

build-linux:
	GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} cmd/server/main.go

build-darwin:
	GOOS=darwin GOARCH=amd64 go build -o ${BINARY_NAME} cmd/server/main.go

run: build
	./${BINARY_NAME_WINDOWS}

test:
	go test -v ./...

clean:
	del ${BINARY_NAME} ${BINARY_NAME_WINDOWS}
